const {Model, DataTypes} = require('sequelize');
const sequelize = require('../config/db');

class RelatedFigures extends Model {}
//历史人物模型
RelatedFigures.init({
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    name: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: '历史人物名称'
    },
    description: {
        type: DataTypes.TEXT,
        allowNull: true,
        comment: '历史人物描述'
    },
    goods_id: {
        type: DataTypes.INTEGER,
        allowNull: false,
        references: {
            model: 'goods',
            key: 'id'
        }
    }
}, {
    sequelize,
    modelName: 'related_figures',
    tableName: 'related_figures',
    timestamps: false
});

module.exports = RelatedFigures;